using System;
using System.Web;

namespace Sedna.Core.Controller.Common
{
	public class BranchOnExecutionContextValueAction : AbstractAction
	{
		private string executionContextValueKey;

		public string ExecutionContextValueKey
		{
			set { executionContextValueKey = value; }
		}

		public override IActionResult Execute(IExecutionContext executionContext)
		{
			string value = (string)executionContext[executionContextValueKey];
			return value==null?CreateResult(successStatus):CreateResult(value);
		}
	}
}
